
#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include "Rectangle.h"

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(Rectangle)
{
    TEST(should be able to set and get length)
    {
        Rectangle rec(0.0, 0.0);
        rec.setLength(3.0);
        ASSERT_EQ(3.0, rec.getLength());
    }

    TEST(should be able to set and get width)
    {
        Rectangle rec(0.0, 0.0);
        rec.setWidth(4.0);
        ASSERT_EQ(4.0, rec.getWidth());
    }

    TEST(should be able to calculate perimeter)
    {
        Rectangle rec(3.0, 4.0);
        ASSERT_EQ(2 * (3.0 + 4.0), rec.getPerimeter());
    }

    TEST(should be able to calculate area)
    {
        Rectangle rec(3.0, 4.0);
        ASSERT_EQ(3.0 * 4.0, rec.getArea());
    }
};

